package healththink

class Post {
    Forum forum
    String message
    Date dateCreated
    User user
    //need to add post status
    
    static belongsTo = [Forum]

    static constraints = {
        message(blank: false, nullable: false, size: 1..500)
        dateCreated(blank:false)
        forum(blank:false)
        user(nullable: false)
    }
    
    static mapping = {
        sort dateCreated: "asc"
        forum lazy:false
    }
}
